#include "MainWidget.h"
#include "LoginDialog.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    System* sys = new System();
    LoginDialog loginDialog(sys);
    MainWidget w(sys);

    QObject::connect(&loginDialog, &LoginDialog::loginSuccessful, [&]() {
        loginDialog.close();
        w.initUi();
        w.flushTable();
        w.flushWidget();
        w.show();
    } );

    loginDialog.show();

    return a.exec();
}
